package com.android.dopewars;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.EditText;

public class HighScoreInfo extends Activity {
	/** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.high_score_info);
        
        ((EditText)findViewById(R.id.high_score_name)).setText(Global.high_score_name_);
        ((EditText)findViewById(R.id.high_score_comment)).setText(Global.high_score_comment_);
        
        ((Button)findViewById(R.id.ok_button)).setOnClickListener(new View.OnClickListener() {
        	public void onClick(View v) {
        		Intent i = new Intent();
        		Global.high_score_name_ = ((EditText)findViewById(R.id.high_score_name)).getText().toString();
        		Global.high_score_comment_ = ((EditText)findViewById(R.id.high_score_comment)).getText().toString();
        		setResult(RESULT_OK, i);
        		finish();
        	}
        });
        
        WindowManager.LayoutParams dialog_params = getWindow().getAttributes();
    	dialog_params.width = WindowManager.LayoutParams.FILL_PARENT;
    	getWindow().setAttributes(dialog_params);
    }
}
